#ifndef _MYSQL_CONN_PTR_
#define _MYSQL_CONN_PTR_

#include <mysql/mysql.h>

#include <log4cxx/logger.h>

using namespace log4cxx;

class MysqlConnPool;

class MysqlConnPtr {

	public:
		MysqlConnPtr();
		int assign(MYSQL * mysql, int index, MysqlConnPool * pool);
		MYSQL * get();
		int get_index();
		int release_to_pool();
		virtual ~MysqlConnPtr();
	private:
		int _index;
		MYSQL * _mysql;
		static LoggerPtr _logger;
		MysqlConnPool * _pool;
};

#endif
